package cn.usian.pricingstrategy.passenger.controller;

import cn.usian.basicInformation.log.commons.Constants;
import cn.usian.basicInformation.log.commons.Log;
import cn.usian.pojo.Result;
import cn.usian.pojo.pricingstrategy.passenger.OperatePassengerCharges;
import cn.usian.pricingstrategy.passenger.service.IPassengerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/passenger")
public class PassengerController {
    @Autowired
    private IPassengerService passengerService;

    @PostMapping("/save")
    @Log(operationModule = "定价策略", operationType = Constants.UPDATE)
    public Result save(@RequestBody OperatePassengerCharges passengerCharges) {
        return Result.ok(passengerService.save(passengerCharges));
    }

    @GetMapping("/list")
    public Result list() {
        return Result.ok(passengerService.list());
    }

    @GetMapping("/findById")
    public Result findById(long id) {
        return Result.ok(passengerService.findById(id));
    }

}
